package net.contrend.material.form;

import java.util.Date;

import net.contrend.util.StringUtils;

import org.apache.struts.action.ActionForm;

/**
 * <p>Copyright @ 2009 www.contrend.net</p>
 * <p>All right reserved. </p>
 * <p>项目名称			： 进销存管理系统 </p>
 * <p>JDK使用版本号		： jdk6.0 </P>
 * <p>描述				： 原料采购项 Form </p>
 * @版本					： 1.0.0 
 * @author				： 谢庚才
 *
 * <p>修改历史 </p>
 * <p>修改时间            修改人员    修改内容 </p>
 * <p>Dec 11, 2009       谢庚才     新建 </p>
 */
public class MaterialPurchaseItemForm extends ActionForm {

	private static final long serialVersionUID = 399792862414320583L;
	/** 采购项Id */
	private String mpiId;
	/** 材料Id */
	private String materialId;
	/** 供应商Id */
	private String msId;
	/** 采购单Id */
	private String psId;
	/** 单价d */
	private Double unitPrice;
	/** 数量 */
	private Double quantity;
	/** 单位 */
	private String unit;
	/** 小计 */
	private Double subtotal;
	private Date createDate;
	private String status;
	
	/** 原材料 */
	private MaterialForm material = new MaterialForm();
	/** 供应商 */
	private MaterialSupplierForm materialSupplier = new MaterialSupplierForm();
	/** 原料采购单 */
	private MaterialPurchaseSheetForm materialPurchaseSheet = new MaterialPurchaseSheetForm();
	
	public String getMpiId() {
		return mpiId;
	}
	public void setMpiId(String mpiId) {
		this.mpiId = mpiId;
	}
	public String getMaterialId() {
		if (StringUtils.isEmpty(this.materialId) && StringUtils.isNotEmpty(this.material.getMaterialId())) {
			this.materialId = this.material.getMaterialId();
		}
		return materialId;
	}
	public void setMaterialId(String materialId) {
		this.materialId = materialId;
	}
	public String getMsId() {
		if (StringUtils.isEmpty(this.msId) && StringUtils.isNotEmpty(this.materialSupplier.getMsId())) {
			this.msId = this.materialSupplier.getMsId();
		}
		return msId;
	}
	public void setMsId(String msId) {
		this.msId = msId;
	}
	public String getPsId() {
		if (StringUtils.isEmpty(this.psId) && StringUtils.isNotEmpty(this.materialPurchaseSheet.getMpsId())) {
			this.psId = this.materialPurchaseSheet.getMpsId();
		}
		return psId;
	}
	public void setPsId(String psId) {
		this.psId = psId;
	}
	public Double getUnitPrice() {
		return unitPrice;
	}
	public void setUnitPrice(Double unitPrice) {
		this.unitPrice = unitPrice;
	}
	public Double getQuantity() {
		return quantity;
	}
	public void setQuantity(Double quantity) {
		this.quantity = quantity;
	}
	public String getUnit() {
		return unit;
	}
	public void setUnit(String unit) {
		this.unit = unit;
	}
	public Double getSubtotal() {
		return subtotal;
	}
	public void setSubtotal(Double subtotal) {
		this.subtotal = subtotal;
	}
	public Date getCreateDate() {
		return createDate;
	}
	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public MaterialForm getMaterial() {
		return material;
	}
	public void setMaterial(MaterialForm material) {
		this.material = material;
	}
	public MaterialSupplierForm getMaterialSupplier() {
		return materialSupplier;
	}
	public void setMaterialSupplier(MaterialSupplierForm materialSupplier) {
		this.materialSupplier = materialSupplier;
	}
	public MaterialPurchaseSheetForm getMaterialPurchaseSheet() {
		return materialPurchaseSheet;
	}
	public void setMaterialPurchaseSheet(
			MaterialPurchaseSheetForm materialPurchaseSheet) {
		this.materialPurchaseSheet = materialPurchaseSheet;
	}
	

}
